/* 
 * Shuriken is the legal property of its developers. Please refer to the
 * COPYRIGHT file distributed with this
 * source distribution.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

using System;
using System.Collections.Generic;
using System.Text;
using Shuriken.Core.Store; 

namespace Shuriken.Core.UI
{
    /// <summary>
    /// Interface implements DisplaySlot functionality 
    /// </summary>
    /// <remarks>
    /// Collects the functionality needed for displaying one display slot 
    /// </remarks>
    interface IUIDisplaySlot
    {
        /// <summary>
        /// Hitmask associated with this display slot 
        /// </summary>
        Shuriken.Core.Ranking.MutableIndexSet HitMask
        {
            get;
        }

        /// <summary>
        /// Search key associated with this display slot 
        /// </summary>
        string SearchKey
        {
            get;
            set; 
        }

        /// <summary>
        /// Items belonging to this display slot 
        /// </summary>
        SortedDisplayItemList DisplayItems
        {
            get;
        }

        /// <summary>
        /// The initial display item list for this slot. 
        /// </summary>
        SortedDisplayItemList InitialDisplayItems
        {
            get; 
        }

        /// <summary>
        /// Index of the currently selected display slot 
        /// </summary>
        int SelectedItemIndex
        {
            get; 
        }

        /// <summary>
        /// True if this is the selected slot 
        /// </summary>
        bool SelectedSlot
        {
            get;
            set; 
        }

        /// <summary>
        /// Current Display Item 
        /// </summary>
        ISearchable SelectedDisplayItem
        {
            get;
            set; 
        }

        /// <summary>
        /// UI Slot visibility 
        /// </summary>
        bool Visible
        {
            get;
            set; 
        }

        /// <summary>
        /// TAB possible on this slot. 
        /// </summary>
        bool IsTABPossible
        {
            get;
        }

        /// <summary>
        /// Back key pressed  
        /// </summary>
        bool BackKeyPressed();

        /// <summary>
        /// Updates the UI with the new content 
        /// </summary>
        /// <param name="SearchKey">Search key</param>
        /// <param name="CurrentIndex">Current Selection</param>
        /// <param name="DisplayItems">Details list</param>
        void UpdateDisplaySlot(string SearchKey, int CurrentIndex, List<ISearchable> DisplayItems);

        /// <summary>
        /// Selects the next item from details
        /// </summary>
        bool SelectNextItemFromDetails();

        /// <summary>
        /// Select the previous item from details. 
        /// </summary>
        bool SelectPreviousItemFromDetails();

        /// <summary>
        /// Selects the current item from details. 
        /// </summary>
        bool SelectCurrentItemFromDetails();

        /// <summary>
        /// Tells if the control is in search mode
        /// </summary>
        bool IsInSearchMode
        {
            get; 
        }

        /// <summary>
        /// Gets the textual represantation of the displayslot
        /// </summary>
        string DisplayText
        {
            get; 
        }

        /// <summary>
        /// Erasing search key in the slot. 
        /// </summary>
        /// <remarks>
        /// This method is used for erasing the search key when for example the control gets selected. 
        /// </remarks>
        void EraseSearchKey();
    }
}
